﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using WeChat.Common;
using WeChat.Model;

namespace WeChat.ViewModel
{
    class ChatViewModel : NotifyBase
    {
        private string _SearchText;
        public string SearchText
        {
            get { return _SearchText; }
            set { _SearchText = value; this.DoNotify(); }
        }
        public ObservableCollection<ChatModel> ChatList { get; set; } = new ObservableCollection<ChatModel>();

        public ChatViewModel()
        {
            this.SearchText = "搜索";
            this.getChatList();
        }

        private void getChatList()
        {
            for (int i = 1; i < 21; i++)
            {
                this.ChatList.Add(new ChatModel { ChatId = i, ChatAvatar = "../Assets/temp/Images/avatar.jpg", ChatName = $"昵称{i}", ChatContent = $"聊天内容{i}", ChatTime = "12:25", ChatVoiceSuppression = true });
            }
        }
    }
}
